package com.wy.hwreader.txtreader;


import com.wy.hwreader.readermain.BookBitmapProcessor;
import com.wy.hwreader.readermain.CallBack;
import com.wy.hwreader.readermain.ReaderContex;
import com.wy.hwreader.readermain.ReaderException.Type;

public class TxtBitmapProcessor extends BookBitmapProcessor {

    @Override
    public void Process(CallBack<Type> callBack, ReaderContex readerContex) {

        TxtReaderContex txtreaderContex = (TxtReaderContex) readerContex;
        int backgroungrs = txtreaderContex.mViewSetting.getPageBackground().getBrawable();
        int textcolor = txtreaderContex.mViewSetting.getPageBackground().getTextColor();
        txtreaderContex.mBitmapManager.ChangePageBitmapColor(txtreaderContex.mContext.getResources(), backgroungrs,
                (int) txtreaderContex.mPaintContex.Viewwidth, (int) txtreaderContex.mPaintContex.Viewheight);
        txtreaderContex.mViewSetting.setTextColor(textcolor);
        txtreaderContex.mPaintContex.CommitSetting();
        txtreaderContex.mBitmapManager.CommitDatatoBitmap();
        txtreaderContex.mBitmapManager.initDraw();
        callBack.onBack(Type.sucess);
    }

}
